import { ComponentType } from "./types";

import {
  ElInput, ElDivider, ElSelect, ElCheckbox, ElSwitch,
  ElButton,
  ElLink,
  ElCascader,
  ElDatePicker,
  ElInputNumber,
  ElRadio,
  ElRadioButton,
  ElSelectV2,
  ElSlider,
  ElTimePicker, ElTimeSelect,
  ElTransfer,
  ElUpload,
  ElAvatar,
  ElCollapse,
  ElCollapseItem,
  ElDescriptions, ElDescriptionsItem,
  ElEmpty,
  ElImage,
  ElProgress,
  ElTag,
  ElCheckTag,
  ElTreeSelect,
  ElRadioGroup
} from 'element-plus'
import { Component } from "vue";
import { IconPicker } from '@/components/SvgIcon'

const componentMap = new Map<ComponentType, Component>()

componentMap.set('ElInput', ElInput)
componentMap.set('ElDivider', ElDivider)
componentMap.set('ElSelect', ElSelect)
componentMap.set('ElSwitch', ElSwitch)
componentMap.set('ElCheckbox', ElCheckbox)
componentMap.set('ElButton', ElButton)
componentMap.set('ElLink', ElLink)
componentMap.set('ElCascader', ElCascader)
componentMap.set('ElDatePicker', ElDatePicker)
componentMap.set('ElInputNumber', ElInputNumber)
componentMap.set('ElRadio', ElRadio)
componentMap.set('ElRadioButton', ElRadioButton)
componentMap.set('ElSelectV2', ElSelectV2)
componentMap.set('ElSlider', ElSlider)
componentMap.set('ElTimePicker', ElTimePicker)
componentMap.set('ElTimeSelect', ElTimeSelect)
componentMap.set('ElTransfer', ElTransfer)
componentMap.set('ElUpload', ElUpload)
componentMap.set('ElAvatar', ElAvatar)
componentMap.set('ElCollapse', ElCollapse)
componentMap.set('ElCollapseItem', ElCollapseItem)
componentMap.set('ElDescriptions', ElDescriptions)
componentMap.set('ElDescriptionsItem', ElDescriptionsItem)
componentMap.set('ElEmpty', ElEmpty)
componentMap.set('ElImage', ElImage)
componentMap.set('ElProgress', ElProgress)
componentMap.set('ElTag', ElTag)
componentMap.set('ElCheckTag', ElCheckTag)
componentMap.set('ElTreeSelect', ElTreeSelect)
componentMap.set('ElRadioGroup', ElRadioGroup)
componentMap.set('IconPicker',IconPicker)


export function add(compName: ComponentType, component: Component) {
  componentMap.set(compName, component);
}

export function del(compName: ComponentType) {
  componentMap.delete(compName);
}

export default componentMap